The present specification relates to the management of embedded scripts in web pages. More specifically, the present specification relates to the management of network traffic by controlling the execution of embedded scripts in web pages.
Many organizations use web analytics services to track the ways in which consumers interact with their websites and other online tools. Web analytics services typically record information provided by web browsers that retrieve web pages. For example, a web analytics service may collect statistical information about the browser type, geographic location, number of visits, and length of visits associated with individual visitors to a certain web page. This statistical information may be presented to the owner of the web page, who may modify or otherwise optimize the web page based on the statistical information to achieve objectives in place for that web page.
In a typical web analytics scenario, the hypertext markup language (HTML) file for a web page may include an embedded script generated by a web analytics service. When a visitor retrieves the web page, his or her browser executes the embedded script, causing the browser to provide certain information about the visitor to a server associated with the web analytics service. For example, an embedded script may cause the browser to compile the information about the visitor, encode the information into a file name according to a predetermined syntax, and request a file having that file name from the server associated with the web analytics service. Unfortunately, the code from the embedded script may be substantially large when compared to the size of the web page. For this reason, the use of embedded analytics scripts in web pages may noticeably delay web page retrieval in slow or congested networks. Moreover, the retrieval and execution of embedded scripts may be inconvenient or costly to visitors accessing the web page through networks with bandwidth-restrictive networks.